﻿using System;
using System.Windows.Controls;

namespace MyFloridaHouse.SilverlightOpenDistricts
{
    public partial class MainPage : UserControl
    {
        private DistrictRenumberDialog districtRenumberDlg;

        private void InitializeDistrictRenumberDiaglog()
        {
            districtRenumberDlg = new DistrictRenumberDialog();
            districtRenumberDlg.DataContext = viewModelBase;
            districtRenumberDlg.Show();
            districtRenumberDlg.Closed += new EventHandler(onDistrictRenumberDiaglogClosedEventHandler);
        }

        private void onDistrictRenumberDiaglogClosedEventHandler(object sender, EventArgs e)
        {
            DistrictRenumberDialog districtRenumberDlg = (DistrictRenumberDialog)sender;
            districtRenumberDlg.Closed -= new EventHandler(onDistrictRenumberDiaglogClosedEventHandler);

            //ViewModelBase.DistrictRenumber((bool)districtRenumberDlg.DialogResult);

            return;
        }
    }
}